#博客首页测试
from selenium.webdriver.common.by import By

from commmon.com import BlogDriver


class BlogList:
    url = ""
    driver = ""
    def __init__(self):
        self.url = "http://8.137.19.140:9090/blog_list.html"
        self.driver = BlogDriver.driver
        self.driver.get(self.url)

    #登陆情况下测试博客首页(标题，内容，按钮)是否存在，个人信息-昵称是否存在
    def ListTestByLogin(self):
        self.driver.find_element( By.CSS_SELECTOR, "body > div.container > div.right > div:nth-child(1) > div.title" )
        self.driver.find_element( By.CSS_SELECTOR, "body > div.container > div.right > div:nth-child(1) > div.desc")
        self.driver.find_element( By.CSS_SELECTOR,"body > div.container > div.right > div:nth-child(1) > a")
        self.driver.find_element( By.CSS_SELECTOR, "body > div.container > div.left > div > h3" )
    #添加屏幕截图
        BlogDriver.getScreenShot()
